package edu.gatech.cs2340.bytebankers.tests;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import edu.gatech.cs2340.bytebankers.model.Journey;
import edu.gatech.cs2340.bytebankers.model.Leader;
import edu.gatech.cs2340.bytebankers.model.Player;
import edu.gatech.cs2340.bytebankers.model.Wagon;
import edu.gatech.cs2340.bytebankers.model.profession.Banker;
import edu.gatech.cs2340.bytebankers.presenter.IStartupPresenter;
import edu.gatech.cs2340.bytebankers.presenter.IStorePresenter;
import edu.gatech.cs2340.bytebankers.presenter.StartupPresenter;
import edu.gatech.cs2340.bytebankers.presenter.StorePresenter;
import edu.gatech.cs2340.bytebankers.view.IStartupView;
import edu.gatech.cs2340.bytebankers.view.IStoreView;
import edu.gatech.cs2340.bytebankers.view.TestStartupView;
import edu.gatech.cs2340.bytebankers.view.TestStoreView;

public class StoreTest {
	@Test
	public void testSaveForm() {
		
		Journey journey = new Journey();
		Wagon wagon = new Wagon();
		Leader leader = new Leader();
		Banker banker = new Banker();
		
		leader.setProfession(banker);
		journey.setLeader(leader);
		journey.setWagon(wagon);
		
		IStorePresenter presenter = new StorePresenter(journey);
		IStoreView view = new TestStoreView(presenter);
		
		assertEquals((int)8000,(int) leader.getMoneyLeft());
		assertEquals(2500, wagon.getAvailableWeight());
		
		presenter.setView(view);
		
		assertEquals("7482.0", 	leader.getMoneyLeft() + "");
		assertEquals(2086, wagon.getAvailableWeight());
	}
}
